package com.example.activity_service.controller;


import com.example.activity_service.service.MsQueryService;
import com.example.activity_service.vo.StopWatch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController("/activity")
@CrossOrigin
@ResponseBody
public class MsController {

    @Autowired
    MsQueryService service;

    @RequestMapping("/login")
    public String diaoyong(){
        return "looklook" ;
    }

    @RequestMapping("/huoqusj")
    public List<StopWatch> huoqusj(StopWatch stopWatch){
        List<StopWatch> list=service.huoqusj();
        return list;
    }
    @RequestMapping("/tjsj")
    public int tjsj(@RequestParam("openingtime")String openingtime,
                    @RequestParam("endtime")String endtime,
                    StopWatch stopWatch){
        System.out.println(openingtime);
        System.out.println(endtime);
        int sj=service.tjsj(stopWatch);
        return sj;
    }
}
